﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QlrrPrintService.Common.Command
{
    public class Bar:PrintLocation,IToTSPLCommand
    {

        private float _width;

        public float Width
        {
            get { return _width; }
            set { _width = value; }
        }

        private float _height;

        public float Height
        {
            get { return _height; }
            set { _height = value; }
        }

        #region IToTSPLCommand 成员

        public byte[] ToTSPLCommandByte(int mm_to_dot)
        {
            return Util.GetEncodingBytes(ToTSPLCommandAscii(mm_to_dot));
        }

        public string ToTSPLCommandAscii(int mm_to_dot)
        {
            return string.Format("BAR {0},{1},{2},{3}{4}", _x * mm_to_dot,
                _y * mm_to_dot, _width * mm_to_dot, _height * mm_to_dot,Common.TSPL_END);
        }

        #endregion
    }

    
}
